<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理左页面</title>
</head>
<link href="<?php echo $this->baseUrl;?>/admincss/style.css" rel="stylesheet" type="text/css" />
<base target='mainFrame' />

<script>
//按tag 获取
$s= function (tag) {return document.getElementsByTagName (tag);}
//给对象添加事件监听
Zl= function (o, e, f){if (typeof (window.attachEvent)!='undefined'){o.attachEvent ('on' + e, f);}else{o.addEventListener (e, f, false)}}
Zl(window, 'load', init);


//初始化
function init () {
var divs = $s ('div');
for (var i=0; i<divs.length; i++) {
if (divs[i].className == 'link_1st') {//给样式为link_1st添加点击事件
    Zl (divs[i], 'click', show);
} else if (divs[i].className == 'link_2st') {//给样式为link_2st添加鼠标移向和移出事件
    Zl (divs[i], 'mouseover', m_over);
    Zl (divs[i], 'mouseout',  m_out );
}}}
//一级菜单点击事件
function show (evt) {
var obj           = evt.target||evt.srcElement;//当前对象
var n             = obj.nextSibling;//兄弟对象，下一个对象
(n.tagName)?'':n=n.nextSibling;     //兼容ff，ff的下一个对象为空白
obj.className     = obj.className == 'link_1st'?'link_1st':'link_1st';
n.style.display   = n.style.display=='none'?'':'none';
}
//鼠标移向操作
function m_over(evt){(evt.target||evt.srcElement).style.background = "#F8F8F8";}
//鼠标移出操作
function m_out(evt){(evt.target||evt.srcElement).style.background = "";}
//打开or关闭全部
function setDisplayList (disp) {
var divs = $s ('div');
for (var i=0; i<divs.length; i++)if (divs[i].className == 'link_list')divs[i].style.display=disp;
return false;
}
</script>
<body>
<!--
<?php
$last_login_time = date ('y.m.d H:i', $this->admininfo ['last_login_time']);
$last_login_ip = long2ip ($this->admininfo ['last_login_ip']);

print <<<EOT
-->
<div class="link_2st" style="height:45px">当前管理员：{$this->admininfo['username']}</br />上次登录时间:{$last_login_time}<br />上次登录IP:{$last_login_ip}</div>
<div id="menu">
<div class="link_dx_s" style="float:left; width: 49%">
    <a href='#' onclick="javascript:return setDisplayList('');">打开全部</a>
</div>
<div class="link_dx_s" style="float:left; width: 49%">
    <a href="#" onclick="javascript:return setDisplayList('none');">关闭全部</a>
</div>

<!--
EOT;
foreach ($this->cadata as $onemenu => $onedetail){
print <<<EOT
-->
<div class="link_1st">
{$onemenu}
</div>
<div class="link_list" style="display:none">
<!--
EOT;
foreach ($onedetail as $twomenu => $ca) {
$param = '';
if (isset($ca['param']))
	$param = $ca['param'];
$gourl = $this->url ($this->baseUrl, $ca ['controller'], $ca ['action'], $param);
print <<<EOT
-->
    <div class="link_2st">
    <a href='{$gourl}'>{$twomenu}</a>
    </div>
    <div class="dort"></div>
<!--
EOT;
}
print <<<EOT
-->
</div>
<!--
EOT;
}
$zxurl = $this->url ($this->baseUrl, "admincp", "cancel");
$logouturl = $this->url ($this->baseUrl, "admincp", "exit");
print <<<EOT
-->
<div class="link_dx_s" style="float:left; width: 49%">
    <a href='{$zxurl}' target=_top>注销</a>
</div>
<div class="link_dx_s" style="float:left; width: 49%">
    <a href='{$logouturl}' target=_top onclick='javascript:return window.confirm("确认退出");'>退出</a>
</div>
<!--
EOT;
?>-->
</body>
</html>
